<?php

/**
 * 短信平台统一的共通类
 * @author Wangfy
 * @date 2019/07/19
 * @package ectools.lib.messenger
 */
class ectools_messenger_app {

    /**
     * @var app object.
     */
    protected $app;

    /**
     * @var array 短信通知类型对应集
     */
    public $arrSmsType = array();

    /**
     * 构造方法
     * @params string - app id
     */
    public function __construct($app) {
        $this->app = $app;
        $this->arrSmsType = array(
            'code' => '验证码',
            'notice' => '通知短信',
            'popularize' => '推广短信'
        );
    }

    /**
     * 得到配置参数
     * @params string key
     * @payment api interface class name
     */
    protected function getConf($key, $appClass) {
        $val = app::get('ectools')->getConf($appClass);
        $val = unserialize($val);
        
        return $val['setting'][$key];
    }
}